//***SOUND***//
#pragma once

//****INCLUDE AND LIBS
#include <windows.h>
#include <mmsystem.h>
#include <dxerr.h>
#include <dsound.h>
#include <string>
#include "dsutil.h"
#include "dxutil.h"

#pragma comment (lib, "dsound.lib") 
#pragma comment (lib, "dxguid.lib")
#pragma comment (lib, "dxerr.lib")
#pragma comment (lib, "winmm.lib")

		//COMPLETE 1

class sdManager
{
public:
	~sdManager(void);

	static sdManager& getInstance() { static sdManager psInstance; return psInstance;}
	bool initDS(HWND hwnd);
	void shutdownDS(void);

	void playSound();
	void stopSound();

private:
	sdManager(void);
	HRESULT hr;
	LPDIRECTSOUNDBUFFER LoadWaveToSoundBuffer(HWND wndHandle,std::string wavFilename);

	LPDIRECTSOUND8 pDS; //DirectSound Device
	LPDIRECTSOUNDBUFFER dsBuffer1; //DirectSound Buffer
	//LPDIRECTSOUNDBUFFER dsBuffer2; //Multiple Sound Buffers

	void playSoundLoop(LPDIRECTSOUNDBUFFER whichBuffer);
	bool loadSB(HWND hwnd);
};